﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NotebookS2
{
    public partial class LockForm : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public LockForm()
        {
            InitializeComponent();
        }

        public string ConnectionString { get; set; }
        public string Password { get; set; }

        private void LockForm_Load(object sender, EventArgs e)
        {
            MainMenu oForm = new MainMenu();
            oForm.Enabled = false;
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("System Force Close", "Authetication", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop) == DialogResult.OK)
            {
                Application.Exit();
            }
            else
            {
                return;
            }
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (txtPassword.Text == this.Password.ToString())
            {
                this.Close();
            }
            else
            {
                toolStripStatusLabel1.ForeColor = System.Drawing.Color.Red;
                toolStripStatusLabel1.Text = "Password is Invalid, Try Again!";
                txtPassword.Focus();
                txtPassword.SelectAll();
            }
        }

        private void txtPassword_Click(object sender, EventArgs e)
        {
            toolStripStatusLabel1.Text = "";
        }
    }
}
